/// Figure 5 Demographics only

clear
set obs 10000
gen AZ2012LatinoProp=rnormal(.18,.002)
gen AZ2012NonLatinoProp=(1-AZ2012LatinoProp)
gen AZ2012LatinoDemVote=rnormal(.598,.05)
gen AZ2012NonLatinoDemVote=.44
gen AZ2012DemVote=(AZ2012LatinoProp*AZ2012LatinoDemVote)+ (AZ2012NonLatinoDemVote*AZ2012NonLatinoProp)
hist AZ2012DemVote, xline(.5) xtitle(Democratic Vote %) xlabel(.45(.025).55) title(2012)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2012 Hist.gph", replace 
sum AZ2012DemVote if AZ2012DemVote>.5

clear
set obs 10000
gen AZ2016LatinoProp=rnormal(.20,.002)
gen AZ2016NonLatinoProp=(1-AZ2016LatinoProp)
gen AZ2016LatinoDemVote=rnormal(.598,.05)
gen AZ2016NonLatinoDemVote=.44
gen AZ2016DemVote=(AZ2016LatinoProp*AZ2016LatinoDemVote)+ (AZ2016NonLatinoDemVote*AZ2016NonLatinoProp)
hist AZ2016DemVote , xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2016)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2016 Hist.gph", replace 
sum AZ2016DemVote if AZ2016DemVote>.5
clear
set obs 10000
gen AZ2020LatinoProp=rnormal(.22,.002)
gen AZ2020NonLatinoProp=(1-AZ2020LatinoProp)
gen AZ2020LatinoDemVote=rnormal(.598,.05)
gen AZ2020NonLatinoDemVote=.44
gen AZ2020DemVote=(AZ2020LatinoProp*AZ2020LatinoDemVote)+ (AZ2020NonLatinoDemVote*AZ2020NonLatinoProp)
hist AZ2020DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2020)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2020 Hist.gph", replace 
sum AZ2020DemVote if AZ2020DemVote>.5
clear
set obs 10000
gen AZ2024LatinoProp=rnormal(.24,.002)
gen AZ2024NonLatinoProp=(1-AZ2024LatinoProp)
gen AZ2024LatinoDemVote=rnormal(.598,.05)
gen AZ2024NonLatinoDemVote=.44
gen AZ2024DemVote=(AZ2024LatinoProp*AZ2024LatinoDemVote)+ (AZ2024NonLatinoDemVote*AZ2024NonLatinoProp)
hist AZ2024DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2024)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2024 Hist.gph", replace
sum AZ2024DemVote if AZ2024DemVote>.5
clear
set obs 10000
gen AZ2028LatinoProp=rnormal(.26,.002)
gen AZ2028NonLatinoProp=(1-AZ2028LatinoProp)
gen AZ2028LatinoDemVote=rnormal(.598,.05)
gen AZ2028NonLatinoDemVote=.44
gen AZ2028DemVote=(AZ2028LatinoProp*AZ2028LatinoDemVote)+ (AZ2028NonLatinoDemVote*AZ2028NonLatinoProp)
hist AZ2028DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2028)
sum AZ2028DemVote if AZ2028DemVote>.5
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2028 Hist.gph", replace
clear
set obs 10000
gen AZ2032LatinoProp=rnormal(.28,.002)
gen AZ2032NonLatinoProp=(1-AZ2032LatinoProp)
gen AZ2032LatinoDemVote=rnormal(.598,.05)
gen AZ2032NonLatinoDemVote=.44
gen AZ2032DemVote=(AZ2032LatinoProp*AZ2032LatinoDemVote)+ (AZ2032NonLatinoDemVote*AZ2032NonLatinoProp)
hist AZ2032DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2032)
sum AZ2032DemVote if AZ2032DemVote>.5
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2032 Hist.gph", replace

graph combine "/Users/joshuazingher/Desktop/AZ-CA paper/2012 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2016 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2020 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2024 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2028 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2032 Hist.gph", graphregion(lcolor(black))

/// Figure 6 Demographics and Preferences

clear
set obs 10000
gen AZ2012LatinoProp=rnormal(.18,.005)
gen AZ2012NonLatinoProp=(1-AZ2012LatinoProp)
gen AZ2012LatinoDemVote=rnormal(.74,.05)
gen AZ2012NonLatinoDemVote=.44
gen AZ2012DemVote=(AZ2012LatinoProp*AZ2012LatinoDemVote)+ (AZ2012NonLatinoDemVote*AZ2012NonLatinoProp)
hist AZ2012DemVote, xline(.5) xtitle(Democratic Vote %) xlabel(.45(.025).55) title(2012)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2012 Hist.gph", replace 
sum AZ2012DemVote if AZ2012DemVote>.5

clear
set obs 10000
gen AZ2016LatinoProp=rnormal(.20,.005)
gen AZ2016NonLatinoProp=(1-AZ2016LatinoProp)
gen AZ2016LatinoDemVote=rnormal(.74,.05)
gen AZ2016NonLatinoDemVote=.44
gen AZ2016DemVote=(AZ2016LatinoProp*AZ2016LatinoDemVote)+ (AZ2016NonLatinoDemVote*AZ2016NonLatinoProp)
hist AZ2016DemVote , xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2016)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2016 Hist.gph", replace 
sum AZ2016DemVote if AZ2016DemVote>.5
clear
set obs 10000
gen AZ2020LatinoProp=rnormal(.22,.005)
gen AZ2020NonLatinoProp=(1-AZ2020LatinoProp)
gen AZ2020LatinoDemVote=rnormal(.74,.05)
gen AZ2020NonLatinoDemVote=.44
gen AZ2020DemVote=(AZ2020LatinoProp*AZ2020LatinoDemVote)+ (AZ2020NonLatinoDemVote*AZ2020NonLatinoProp)
hist AZ2020DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2020)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2020 Hist.gph", replace 
sum AZ2020DemVote if AZ2020DemVote>.5
clear
set obs 10000
gen AZ2024LatinoProp=rnormal(.24,.005)
gen AZ2024NonLatinoProp=(1-AZ2024LatinoProp)
gen AZ2024LatinoDemVote=rnormal(.74,.05)
gen AZ2024NonLatinoDemVote=.44
gen AZ2024DemVote=(AZ2024LatinoProp*AZ2024LatinoDemVote)+ (AZ2024NonLatinoDemVote*AZ2024NonLatinoProp)
hist AZ2024DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2024)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2024 Hist.gph", replace
sum AZ2024DemVote if AZ2024DemVote>.5
clear
set obs 10000
gen AZ2028LatinoProp=rnormal(.26,.005)
gen AZ2028NonLatinoProp=(1-AZ2028LatinoProp)
gen AZ2028LatinoDemVote=rnormal(.74,.05)
gen AZ2028NonLatinoDemVote=.44
gen AZ2028DemVote=(AZ2028LatinoProp*AZ2028LatinoDemVote)+ (AZ2028NonLatinoDemVote*AZ2028NonLatinoProp)
hist AZ2028DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2028)
sum AZ2028DemVote if AZ2028DemVote>.5
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2028 Hist.gph", replace
clear
set obs 10000
gen AZ2032LatinoProp=rnormal(.28,.005)
gen AZ2032NonLatinoProp=(1-AZ2032LatinoProp)
gen AZ2032LatinoDemVote=rnormal(.74,.05)
gen AZ2032NonLatinoDemVote=.44
gen AZ2032DemVote=(AZ2032LatinoProp*AZ2032LatinoDemVote)+ (AZ2032NonLatinoDemVote*AZ2032NonLatinoProp)
hist AZ2032DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2032)
sum AZ2032DemVote if AZ2032DemVote>.5
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2032 Hist.gph", replace

graph combine "/Users/joshuazingher/Desktop/AZ-CA paper/2012 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2016 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2020 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2024 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2028 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2032 Hist.gph", graphregion(lcolor(black))


/// Figure 7 Demographics, TO and Preferences

clear
set obs 10000
gen AZ2012LatinoProp=rnormal(.19,.005)
gen AZ2012NonLatinoProp=(1-AZ2012LatinoProp)
gen AZ2012LatinoDemVote=rnormal(.74,.05)
gen AZ2012NonLatinoDemVote=.44
gen AZ2012DemVote=(AZ2012LatinoProp*AZ2012LatinoDemVote)+ (AZ2012NonLatinoDemVote*AZ2012NonLatinoProp)
hist AZ2012DemVote, xline(.5) xtitle(Democratic Vote %) xlabel(.45(.025).55) title(2012)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2012 Hist.gph", replace 
sum AZ2012DemVote if AZ2012DemVote>.5

clear
set obs 10000
gen AZ2016LatinoProp=rnormal(.21,.005)
gen AZ2016NonLatinoProp=(1-AZ2016LatinoProp)
gen AZ2016LatinoDemVote=rnormal(.74,.05)
gen AZ2016NonLatinoDemVote=.44
gen AZ2016DemVote=(AZ2016LatinoProp*AZ2016LatinoDemVote)+ (AZ2016NonLatinoDemVote*AZ2016NonLatinoProp)
hist AZ2016DemVote , xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2016)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2016 Hist.gph", replace 
sum AZ2016DemVote if AZ2016DemVote>.5
clear
set obs 10000
gen AZ2020LatinoProp=rnormal(.23,.005)
gen AZ2020NonLatinoProp=(1-AZ2020LatinoProp)
gen AZ2020LatinoDemVote=rnormal(.74,.05)
gen AZ2020NonLatinoDemVote=.44
gen AZ2020DemVote=(AZ2020LatinoProp*AZ2020LatinoDemVote)+ (AZ2020NonLatinoDemVote*AZ2020NonLatinoProp)
hist AZ2020DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2020)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2020 Hist.gph", replace 
sum AZ2020DemVote if AZ2020DemVote>.5
clear
set obs 10000
gen AZ2024LatinoProp=rnormal(.25,.005)
gen AZ2024NonLatinoProp=(1-AZ2024LatinoProp)
gen AZ2024LatinoDemVote=rnormal(.74,.05)
gen AZ2024NonLatinoDemVote=.44
gen AZ2024DemVote=(AZ2024LatinoProp*AZ2024LatinoDemVote)+ (AZ2024NonLatinoDemVote*AZ2024NonLatinoProp)
hist AZ2024DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2024)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2024 Hist.gph", replace
sum AZ2024DemVote if AZ2024DemVote>.5
clear
set obs 10000
gen AZ2028LatinoProp=rnormal(.27,.005)
gen AZ2028NonLatinoProp=(1-AZ2028LatinoProp)
gen AZ2028LatinoDemVote=rnormal(.74,.05)
gen AZ2028NonLatinoDemVote=.44
gen AZ2028DemVote=(AZ2028LatinoProp*AZ2028LatinoDemVote)+ (AZ2028NonLatinoDemVote*AZ2028NonLatinoProp)
hist AZ2028DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2028)
sum AZ2028DemVote if AZ2028DemVote>.5
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2028 Hist.gph", replace
clear
set obs 10000
gen AZ2032LatinoProp=rnormal(.29,.005)
gen AZ2032NonLatinoProp=(1-AZ2032LatinoProp)
gen AZ2032LatinoDemVote=rnormal(.74,.05)
gen AZ2032NonLatinoDemVote=.44
gen AZ2032DemVote=(AZ2032LatinoProp*AZ2032LatinoDemVote)+ (AZ2032NonLatinoDemVote*AZ2032NonLatinoProp)
hist AZ2032DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.45(.025).55) title(2032)
sum AZ2032DemVote if AZ2032DemVote>.5
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2032 Hist.gph", replace

graph combine "/Users/joshuazingher/Desktop/AZ-CA paper/2012 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2016 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2020 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2024 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2028 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2032 Hist.gph", graphregion(lcolor(black))

/// Racial Polarization 

clear
set obs 10000
gen AZ2012LatinoProp=rnormal(.19,.005)
gen AZ2012NonLatinoProp=(1-AZ2012LatinoProp)
gen AZ2012LatinoDemVote=rnormal(.74,.05)
gen AZ2012NonLatinoDemVote=.32
gen AZ2012DemVote=(AZ2012LatinoProp*AZ2012LatinoDemVote)+ (AZ2012NonLatinoDemVote*AZ2012NonLatinoProp)
hist AZ2012DemVote, xline(.5) xtitle(Democratic Vote %) xlabel(.35(.05).55) title(2012)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2012 Hist.gph", replace 
sum AZ2012DemVote if AZ2012DemVote>.5

clear
set obs 10000
gen AZ2016LatinoProp=rnormal(.21,.005)
gen AZ2016NonLatinoProp=(1-AZ2016LatinoProp)
gen AZ2016LatinoDemVote=rnormal(.74,.05)
gen AZ2016NonLatinoDemVote=.32
gen AZ2016DemVote=(AZ2016LatinoProp*AZ2016LatinoDemVote)+ (AZ2016NonLatinoDemVote*AZ2016NonLatinoProp)
hist AZ2016DemVote , xline(.5) xtitle(Democratic Vote %)  xlabel(.35(.05).55) title(2016)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2016 Hist.gph", replace 
sum AZ2016DemVote if AZ2016DemVote>.5
clear
set obs 10000
gen AZ2020LatinoProp=rnormal(.23,.005)
gen AZ2020NonLatinoProp=(1-AZ2020LatinoProp)
gen AZ2020LatinoDemVote=rnormal(.74,.05)
gen AZ2020NonLatinoDemVote=.32
gen AZ2020DemVote=(AZ2020LatinoProp*AZ2020LatinoDemVote)+ (AZ2020NonLatinoDemVote*AZ2020NonLatinoProp)
hist AZ2020DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.35(.05).55) title(2020)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2020 Hist.gph", replace 
sum AZ2020DemVote if AZ2020DemVote>.5
clear
set obs 10000
gen AZ2024LatinoProp=rnormal(.25,.005)
gen AZ2024NonLatinoProp=(1-AZ2024LatinoProp)
gen AZ2024LatinoDemVote=rnormal(.74,.05)
gen AZ2024NonLatinoDemVote=.32
gen AZ2024DemVote=(AZ2024LatinoProp*AZ2024LatinoDemVote)+ (AZ2024NonLatinoDemVote*AZ2024NonLatinoProp)
hist AZ2024DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.35(.05).55) title(2024)
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2024 Hist.gph", replace
sum AZ2024DemVote if AZ2024DemVote>.5
clear
set obs 10000
gen AZ2028LatinoProp=rnormal(.27,.005)
gen AZ2028NonLatinoProp=(1-AZ2028LatinoProp)
gen AZ2028LatinoDemVote=rnormal(.74,.05)
gen AZ2028NonLatinoDemVote=.32
gen AZ2028DemVote=(AZ2028LatinoProp*AZ2028LatinoDemVote)+ (AZ2028NonLatinoDemVote*AZ2028NonLatinoProp)
hist AZ2028DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.35(.05).5) title(2028)
sum AZ2028DemVote if AZ2028DemVote>.5
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2028 Hist.gph", replace
clear
set obs 10000
gen AZ2032LatinoProp=rnormal(.29,.005)
gen AZ2032NonLatinoProp=(1-AZ2032LatinoProp)
gen AZ2032LatinoDemVote=rnormal(.74,.05)
gen AZ2032NonLatinoDemVote=.32
gen AZ2032DemVote=(AZ2032LatinoProp*AZ2032LatinoDemVote)+ (AZ2032NonLatinoDemVote*AZ2032NonLatinoProp)
hist AZ2032DemVote, xline(.5) xtitle(Democratic Vote %)  xlabel(.35(.05).5) title(2032)
sum AZ2032DemVote if AZ2032DemVote>.5
graph save Graph "/Users/joshuazingher/Desktop/AZ-CA paper/2032 Hist.gph", replace

graph combine "/Users/joshuazingher/Desktop/AZ-CA paper/2012 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2016 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2020 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2024 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2028 Hist.gph" "/Users/joshuazingher/Desktop/AZ-CA paper/2032 Hist.gph", graphregion(lcolor(black))

